package week10;
import java.net.URL;
/**
 * Created by dell on 2017/4/27.
 */
public class URLDemo1 {
    public static void main(String [] args) throws Exception{
        URL url = new URL(
                "http://www.yahoo.com:80/en/index.html?name=john#first"
        );
        System.out.println("protocal:"+url.getProtocol());
        System.out.println("port:"+url.getPort());
        System.out.println("host:"+url.getHost());
        System.out.println("path:"+url.getPath());
        System.out.println("file:"+url.getFile());
        System.out.println("query:"+url.getQuery());
        System.out.println("ref:"+url.getRef());
    }
}
